home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Comms Spectacular / finger_server_0.6 / MacTCP_includes / MiscIPPB.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-29  |  2.5 KB  |  103 lines  |  [TEXT/MPS ]

  1. /* 
  2.     IPPB.h    
  3.     C definitions of parameter block entries needed for IP calls
  4.  
  5.     Copyright Apple Computer, Inc. 1988-91 
  6.     All rights reserved
  7.     
  8. */
  9.  
  10. /* control codes */
  11. #define ipctlEchoICMP        17            /* send icmp echo */
  12. #define ipctlLAPStats        19            /* get lap stats */
  13.  
  14. #define icmpEchoTimeoutErr         -23035            /* ICMP echo timed-out */
  15.  
  16. #define ParamBlockHeader     \
  17.     struct QElem *qLink;     \
  18.     short qType;             \
  19.     short ioTrap;             \
  20.     Ptr ioCmdAddr;             \
  21.     ProcPtr ioCompletion;     \
  22.     OSErr ioResult;         \
  23.     StringPtr ioNamePtr;     \
  24.     short ioVRefNum;        \
  25.     short ioCRefNum;        \
  26.     short csCode
  27.     
  28. typedef void (*ICMPEchoNotifyProc) (struct ICMPParamBlock *iopb);
  29.  
  30.  
  31. struct IPParamBlock {
  32.     ParamBlockHeader;                    /* standard I/O header */
  33.     union {
  34.         struct {
  35.             ip_addr    dest;                /* echo to IP address */
  36.             wdsEntry data;
  37.             short timeout;
  38.             Ptr options;
  39.             unsigned short optLength;
  40.             ICMPEchoNotifyProc icmpCompletion;
  41.             unsigned long userDataPtr;
  42.             } IPEchoPB;
  43.         struct {
  44.             struct LAPStats *lapStatsPtr;
  45.             } LAPStatsPB;
  46.         } csParam;
  47.     };
  48.  
  49. struct ICMPParamBlock {
  50.     ParamBlockHeader;                    /* standard I/O header */
  51.     short params[11];
  52.     struct {
  53.         unsigned long echoRequestOut;    /* time in ticks of when the echo request went out */
  54.         unsigned long echoReplyIn;        /* time in ticks of when the reply was received */
  55.         struct rdsEntry echoedData;        /* data received in responce */
  56.         Ptr options;
  57.         unsigned long userDataPtr;
  58.         } icmpEchoInfo;
  59.     };
  60.  
  61.     
  62. typedef struct LAPStats {
  63.     short    ifType;
  64.     char    *ifString;
  65.     short    ifMaxMTU;
  66.     long    ifSpeed;
  67.     short    ifPhyAddrLength;
  68.     char    *ifPhysicalAddress;
  69.     union {
  70.         struct arp_entry *arp_table;    
  71.         struct nbp_entry *nbp_table;
  72.         } AddrXlation;
  73.     short    slotNumber;
  74.     };
  75.     
  76. #define NBP_TABLE_SIZE    20                /* number of NBP table entries */
  77. #define NBP_MAX_NAME_SIZE    16+10+2
  78.  
  79. struct nbp_entry {
  80.     ip_addr     ip_address;                /* IP address */
  81.     AddrBlock    at_address;                /* matching AppleTalk address */
  82.     Boolean        gateway;                /* TRUE if entry for a gateway */
  83.     Boolean        valid;                    /* TRUE if LAP address is valid */
  84.     Boolean        probing;                /* TRUE if NBP lookup pending */
  85.     int            age;                    /* ticks since cache entry verified */
  86.     int            access;                    /* ticks since last access */
  87.     char        filler[116];            /* for internal use only !!! */
  88.     };
  89.  
  90. #define ARP_TABLE_SIZE    20                /* number of ARP table entries */
  91.  
  92. typedef struct Enet_addr {
  93.     b_16 en_hi;
  94.     b_32 en_lo;
  95.     } Enet_addr;
  96.  
  97. typedef struct arp_entry {
  98.     short        age;            /* cache aging field */
  99.     b_16        protocol;        /* Protocol type */
  100.     ip_addr     ip_address;        /* IP address */
  101.     Enet_addr    en_address;        /* matching Ethernet address */
  102.     };
  103.